package com.pos43.business.dao.impl;

import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.pos43.business.dao.IOrdersDao;
import com.pos43.domain.Orders;

public class OrdersDao extends HibernateDaoSupport implements IOrdersDao{

	public Orders get(Integer id){
		return getHibernateTemplate().get(Orders.class, id);
	}

	public Integer save(Orders order){
		return (Integer)getHibernateTemplate()
			.save(order);
	}
	
	public void update(Orders order){
		getHibernateTemplate().update(order);
	}
	
	public void delete(Orders order){
		getHibernateTemplate().delete(order);
	}
	
	public void delete(Integer id){
		getHibernateTemplate().delete(get(id));
	}
	
	public List<Orders> findAll(){
		return (List<Orders>)getHibernateTemplate()
				.find("from Orders");
	}

}
